package tt.dz.egobus.servicemanager.service;

import tt.dz.egobus.api.managerservice.manager.BusinessBaseLimitStatus;
import tt.dz.egobus.api.managerservice.manager.PageVo;
import tt.dz.egobus.bean.Pagination;
import tt.dz.egobus.servicemanager.base.service.ExtendBaseService;
import tt.dz.egobus.servicemanager.business.point.AddressPoint;
import tt.dz.egobus.servicemanager.business.point.BusPoint;
import tt.dz.egobus.servicemanager.entities.BusinessService;
import tt.dz.egobus.servicemanager.entities.BusinessServiceInfo;
import tt.dz.egobus.servicemanager.entities.DriverRegisterBusRelative;
import tt.dz.egobus.servicemanager.vo.BusinessFinishVo;
import tt.dz.egobus.servicemanager.vo.BusinessRequestVo;

import java.util.Date;
import java.util.List;

/**
 * @author Anson
 * @date 17-3-15
 * @name 业务服务详细层
 * @since 1.0.3
 */
public interface BusinessServiceInfoService extends ExtendBaseService<BusinessServiceInfo, String> {

    /**
     * @param businessService   当前所关联的业务详细
     * @param busPoint          司机当前接受派单地理位置
     * @param businessRequestVo 业务请求vo
     * @param relative
     * @author Anson
     * @date 17-3-28
     * @name 新生成一个业务详细表
     * @since 1.0.3
     */
    boolean saveBeginBusinessService(BusinessService businessService, BusPoint busPoint, BusinessRequestVo
            businessRequestVo, DriverRegisterBusRelative relative);

    /**
     * @param businessService 当前所关联的业务详细
     * @param addressPoint    司机当前接受派单地理位置
     * @author Anson
     * @date 17-3-28
     * @name
     * @since 1.0.3
     */
    boolean doSaveBusiness(BusinessService businessService, AddressPoint addressPoint);


    /**
     * @param businessServiceId
     * @author Anson
     * @date 17-3-28
     * @name 根据业务id获详细信息
     * @since 1.0.3
     */
    BusinessServiceInfo getInfoByServiceId(String businessServiceId);

    /**
     * @param info            服务基详细信息
     * @param status          基本增值信息
     * @param businessService 服务基本信息
     * @param vo              完成的业务请求详细
     * @author Anson
     * @date 17-3-29
     * @name 保存在完成时候的业务
     * @since 1.0.3
     */
    boolean doSaveFinish(BusinessServiceInfo info, BusinessBaseLimitStatus status, BusinessService businessService, BusinessFinishVo vo);

    /**
     * @param driverId 司机id
     * @author Anson
     * @date 17-4-11
     * @name 获取司机最近的一次派单信息
     * @since 1.0.4
     */
    BusinessServiceInfo getDriverLastestTaskInfo(String driverId);

    /**
     * @param businessId 业务流水号
     * @author Anson
     * @date 17-5-16
     * @name 根据业务号获取业务细节信息
     * @since 1.0.4
     */
    BusinessServiceInfo getInfoByBusinessId(String businessId);

    /**
     * @param driverId 司机主键
     * @author Anson
     * @date 17-8-29
     * @name 根据司机主键查询司机预约未完成的日期列表
     * @since 1.0.7
     */
    List<String> queryDriverBespeakUnDoneDates(String driverId);

    /**
     * @param driverId 司机主键
     * @author Anson
     * @date 17-8-29
     * @name 根据司机主键查询司机预约未完成的详细预约列表
     * @since 1.0.7
     */
    List<BusinessServiceInfo> queryDriverBespeakUnDoneInfos(String driverId);

    /**
     * @param businessIds 当前业务流水号数据集合
     * @author Anson
     * @date 17-3-28
     * @name 获取当前有效的拍单视图信息
     * 若当前业务[isValidate]逻辑删除状态为false,则返回null
     * @since 1.0.7
     */
    List<BusinessServiceInfo> getInfoByBusinessIds(String[] businessIds);

    /**
     * @param driverId
     * @param date
     * @author Anson
     * @date 17-8-30
     * @name 判断司机在某天是否存在预约单
     * @since 1.0.7
     */
    boolean isContainerDriverBespeakDate(String driverId, Date date);

    /**
     * @param businessService   当前所关联的业务详细
     * @param busPoint          司机当前接受派单地理位置
     * @param businessRequestVo 业务请求vo
     * @param relative
     * @author Anson
     * @date 17-3-28
     * @name 新生成一个预约业务详细表
     * @since 1.0.7
     */
    boolean doBespeakBusiness(BusinessService businessService, BusPoint busPoint, BusinessRequestVo
            businessRequestVo, DriverRegisterBusRelative relative);

    /**
     * 分页查询业务详情信息
     *
     * @param vo 分页查询参数
     * @author Jack
     * @date 2017/9/1
     * @name
     * @since 1.0.7
     */
    Pagination<BusinessServiceInfo> queryBusinessInfoByPage(PageVo vo);
}

